p<-read.csv(file.choose())
p
summary(p)
summary(p$SYSBP)
class(p)
str(p)
sex<-p$SEX
sexC<-as.character(sex)
sexF<-factor(sexC,levels=c(1,2),labels=c("men","women"))
class(sex)
class(sexC)
class(sexF)
head(p$SYBSP)
summary(p$SYSBP)
table(p$SEX)
hist(p$SYSBP,prob=T)
boxplot(p$SYSBP)
hist(p$SYSBP,freq=FALSE,main="Histogram",ylab="Probabilities",col="green")
boxplot(p$SYSBP,horizontal=TRUE,col="red")
boxplot(SYSBP~SEX,data=p)
library(tidyverse)
install.packages("tidyverse")
ggplot(p,aes(x=1,y=SYSBP))+geom_boxplot()
ggplot(p,aes(x=factor(SEX),y=SYSBP))+geom_boxplot()
ggplot(p,aes(x=factor(SEX),y=SYSBP,fill=SEX))+geom_boxplot()
ggplot(p,aes(x=factor(SEX),y=SYSBP,col=SEX))+geom_boxplot()